static int waypoint_read_count;
static int wpt_len = 8;
static const char *curfname;
+/*
+ * Magellan's firmware is *horribly* slow to send the next packet after
+ * we turn around an ack while we are reading from the device. It's
+ * quite spiffy when we're writing to the device. Since we're *way*
+ * less likely to lose data while reading from it than it is to lose data
+ * when we write to it, we turn off the acks when we are predominatly
+ * reading.
+ */
+static int suppress_ack;
typedef enum {
mrs_handoff = 0,
*/
const char *s = strrchr(curfname, GB_PATHSEP);
char *e;
-
trk_head = route_head_alloc();
+
if (s) {
s++; /* Skip path delim */
} else {
found_done = 1;
return;
}
- if (magrxstate != mrs_handoff)
+
+ if (magrxstate != mrs_handoff) {
mag_writeack(isum);
+ }
}
static void *serial_handle = NULL;
{
time_t now, later;
waypoint_read_count = 0;
-
+
if (bs) {
bitrate=atoi(bs);
}
if (!mkshort_handle) {
mkshort_handle = mkshort_new_handle();
}
-
- if (!noack)
+
+ mag_handoff();
+ if (!noack && !suppress_ack)
mag_handon();
now = current_time();
mag_rd_init(const char *portname)
{
explorist = 0;
+ suppress_ack = 1;
mag_rd_init_common(portname);
}
static void
mag_wr_init_common(const char *portname)
{
+ suppress_ack = 0;
if (bs) {
bitrate=atoi(bs);
}
}
}
+ found_done = 0;
if (global_opts.masked_objective & WPTDATAMASK) {
magrxstate = mrs_handoff;
if (!is_file)
}
}
+ found_done = 0;
if (global_opts.masked_objective & RTEDATAMASK) {
magrxstate = mrs_handoff;
if (!is_file) {